import java.sql.ResultSet;
import java.sql.Statement;

public class SelectExample {
    public static void main(String[] args) throws Exception {
        // 实例化数据库对象
        Database database = new Database();
        // 获取数据库控制器
        Statement statement = database.getStatement();
        // 执行 SQL 语句
        ResultSet resultSet = statement.executeQuery("SELECT * FROM user");
        // 遍历查询结果
        while (resultSet.next()) {
            String row = resultSet.getInt("id") + "=>" + resultSet.getString("name");
            System.out.println(row); // 1=>shann
        }
    }
}
